<template>
	<view >
		<u-swiper :list="list1"  indicator ></u-swiper>
		<u-button @click="navigation">导航</u-button>
	
	</view>
</template>

<script>
	export default {
		data() {
			return {
				station:{},
				stationId:'',
				list1: [
					'https://img95.699pic.com/desgin_photo/40214/3525_list.jpg',
					'https://img2.baidu.com/it/u=485869087,2083011680&fm=253&fmt=auto&app=138&f=JPEG?w=1597&h=500',
					'https://cdn.uviewui.com/uview/swiper/swiper3.png',
				],
			}
		},
		onLoad: function (option) { //option为object类型，会序列化上个页面传递的参数
					let that=this;
					console.log(option.stationId)
					wx.request({
						url: "http://localhost:8081/station/showOne",
						method: "POST",
						data:{
							stationId:option.stationId
						},
						header: {
							"Content-Type": "application/x-www-form-urlencoded"
						},
						success(resp){
							console.log(resp.data.data)
							that.station=resp.data.data
						}
					})
				},
			
		methods: {
			// 导航
			navigation(){
				let that=this;
				wx.openLocation({
				  latitude: that.station.dimensionality,
				  longitude: that.station.longitude,
				  name: that.station.stationName,
				  address: that.station.address
				})

			}
			
		}
	}
</script>

<style>

</style>
